package com.itmk.utils;

import com.itmk.state.StatesCode;

public class ResultUtils {

    public static ResultVO Vo(String msg,int code,Object data){
        return new ResultVO(msg,code,data);
    }
//    无参数返回
    public static ResultVO success(){
        return Vo(null, StatesCode.SUCCESS_CODE,null);
    }

    public static ResultVO success(String msg){
        return Vo(msg, StatesCode.SUCCESS_CODE,null);
    }
//返回带参数
    public static ResultVO success(String msg,int code,Object data){
        return Vo(msg, code,data);
    }
    public static ResultVO success(String msg,Object data){
        return Vo(msg, StatesCode.SUCCESS_CODE,data);
    }

//    错误返回

    public static ResultVO error(){
        return Vo(null, StatesCode.ERROR_CODE,null);
    }

    public static ResultVO error(String msg){
        return Vo(msg, StatesCode.ERROR_CODE,null);
    }

    public static ResultVO error(String msg,int code,Object data){
        return Vo(msg, code,data);
    }

    public static ResultVO error(String msg,int code){
        return Vo(msg, code,null);
    }

    public static ResultVO error(String msg,Object data){
        return Vo(msg, StatesCode.ERROR_CODE,data);
    }
}
